//知识产权
<template>
  <div class="module_">
      <el-tabs v-model="activeName"  class="tabs" type="card">
        <el-tab-pane label="专利成果" name="1"></el-tab-pane>
        <el-tab-pane label="成果转化" name="2"></el-tab-pane>
        <el-tab-pane v-if="adminShow" label="专利统计" name="3"></el-tab-pane>
      </el-tabs>
      <transition name="el-fade-in-linear">
        <component v-bind:is="choseComp" ref="comp" ></component>
      </transition> 
  </div>
</template>

<script>
import patent from '../components/patent'
import conversion from '../components/conversion'
import patentStatistical from '../components/patentStatistical'
import {adminShow} from "@/utils/index";

export default {
    components:{
       patent,
       conversion,
       patentStatistical
    },
    data(){
        return{
            adminShow:adminShow(),
            activeName: '1',
            options:{
                '1': patent,
                '2': conversion,
                '3': patentStatistical
            }
        }
    },
    computed:{
        choseComp(){
            return this.options[this.activeName]
        },
        editFormVisible(){
            return this.$refs.comp.editFormVisible
        },
    },
    created(){
        if(sessionStorage.getItem('patentstatistical')){
            this.activeName = "3"
        }
    },
    mounted(){
        const activeName = this.$route.query.activeName
        if(activeName  && this.options[activeName]) {
            this.activeName = activeName
        }
    },
    methods:{
        submit(){
            return this.$refs.comp.submit()
        }
    }
}
</script>

<style>

</style>